﻿using System.Data.Entity.ModelConfiguration;
using Nop.Core.Domain.ShowCase;

namespace Nop.Data.Mapping.ShowCase
{
    public class ShowCaseProductItemMapping:EntityTypeConfiguration<ShowCaseProductItem>
    {
        public ShowCaseProductItemMapping()
        {
            this.ToTable("ShowCaseProductItem");
            this.HasKey(c => c.Id);

            this.Property(u => u.Sort);

            this.HasRequired(b => b.ShowCaseProduct).WithMany().HasForeignKey(b => b.ShowCaseProduct_Id);

            this.HasRequired(b => b.Product)
                .WithMany()
                .HasForeignKey(b => b.ProductId);

        }
    }
}